package com.easy.service.impl;

import com.easy.bean.Order;
import com.easy.dao.IInInventoryDao;
import com.easy.service.IInInventoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class IInInventoryImpl implements IInInventoryService {
    @Autowired
    private IInInventoryDao dao;

    @Override
    public List<Order> getInInventory() {
        return dao.getInInventory();
    }

    @Override
    public List<Order> getShelfInInventory() {
        return dao.getShelfInInventory();
    }

    @Override
    public int addInInventory(Order order) {
        return dao.addInInventory(order);
    }

    @Override
    public int editInInventory(Order order) {
        return dao.editInInventory(order);
    }

    @Override
    public int delInInventory(int id) {
        return dao.delInInventory(id);
    }

    @Override
    public List<Order> searchInInventory(String keyword) {
        return dao.searchInInventory(keyword);
    }
    @Override
    public List<Order> getPagedInInventory(int page, int size) {
        int offset = (page - 1) * size; // 计算 offset
        return dao.getPagedInInventory(offset, size);
    }
    @Override
    public int getTotalInInventoryCount() {
        return dao.getTotalInInventoryCount();
    }
}
